<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function Student(name,age,gender){
            this.name=name;
            this.age=age;
            this.gender=gender;
        }
        // Student.prototype.say=function(){
        //     alert("hello hahhaha");
        // }
        // Student.prototype.run=function(){
        //     alert("run------");
        // }

        Student.prototype={
            constructor:Student,
            enjoy:function(){
                alert("enjoy");
            },
            work:function(){
                alert("work-----")
            }

        }
        var stu1=new Student("lisi",12,"female");
        var stu2=new Student("tom",56,"male");

        stu1.enjoy();
        stu1.work();
        //此时say和run不能调用了
        console.log(stu1.constructor);
        console.log(stu2.constructor);
        // stu1.say();
        // stu2.say();
        // console.log(stu1.say==stu2.say);
        
    </script>
</head>
<body>
    
</body>
</html>